import qs from 'qs'
import { success } from './index'
import { clientTypes, clients, devices, apps } from './models'


export default {
    'get!/clientTypes': config => {
        return success(clientTypes)
    },
    'get!/clients/url0001/devices': config => {
        return success(devices)
    },
    'get!/clients/url0002/devices': config => {
        return success(devices)
    },
    'get!/clients/url0001/apps': config => {
        return success(apps)
    },
    'get!/clients/url0002/apps': config => {
        return success(apps)
    },
    'get!/clients': config => {
        const { type } = qs.parse(config.url.split('?')[1])
        return success({
            total: 40,
            list: clients
        })
    },

}
